package com.seisys.controller.config;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.seisys.controller.base.BaseController;
import com.seisys.service.config.configService;
import com.seisys.util.IData;
import com.seisys.util.IDataList;

@Controller
@RequestMapping(value = "/config")
public class configController extends BaseController {

	Logger log = Logger.getLogger(configController.class);

	@Resource(name = "configService")
	private configService service;

	/**
	 * 
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	@RequestMapping(value = "/getData")
	@ResponseBody
	public Object getData(HttpServletRequest request) {
		Map<String, Object> result = new HashMap<String, Object>();

		List list = IDataList.getInstance();
		IData param = IData.getInstance(request);
		try {
			list = (List) service.getDataList(param);
		} catch (Exception e) {
			e.printStackTrace();
		}
		result.put("datas", list);
		return result;
	}

}
